package com.warehouse.module.business.dal.mysql.cargofile;

import java.util.*;

import com.warehouse.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.warehouse.framework.mybatis.core.mapper.BaseMapperX;
import com.warehouse.module.business.controller.admin.cargofile.vo.CargoFileReqVO;
import com.warehouse.module.business.dal.dataobject.cargofile.CargoFileDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 货物资料附件 Mapper
 *
 * @author admin
 */
@Mapper
public interface CargoFileMapper extends BaseMapperX<CargoFileDO> {

    default List<CargoFileDO> selectList(CargoFileReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<CargoFileDO>()
                .eqIfPresent(CargoFileDO::getFileId, reqVO.getFileId())
                .eqIfPresent(CargoFileDO::getFileType, reqVO.getFileType())
                .betweenIfPresent(CargoFileDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CargoFileDO::getCargoId, reqVO.getCargoId())
                .orderByDesc(CargoFileDO::getId));
    }

}